﻿<UserControl  
             x:Class="NMortgage.UI.Views.InterestParameterListView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:Properties="clr-namespace:NMortgage.UI.Properties"
             xmlns:my="clr-namespace:Microsoft.Windows.Controls.Chromes;assembly=WPFToolkit.Extended" 
             xmlns:cal="http://www.caliburnproject.org"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300" >
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="../Themes/CommonStyles.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>

    </UserControl.Resources>
    <Border Style="{StaticResource Section}" >
        <Grid x:Name="LayoutRoot">
            <Grid.RowDefinitions>
                <RowDefinition Height="26" />
                <RowDefinition Height="*"  />
                <RowDefinition Height="26" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="26" />
                <ColumnDefinition Width="26" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="26" />
                <ColumnDefinition Width="26" />
            </Grid.ColumnDefinitions>

            <TextBlock x:Name="Title" Grid.Row="0" Grid.Column="2" />
            
            <ScrollViewer Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="5" >
                <ItemsControl x:Name="ItemCollection" Style="{StaticResource ItemsControlListStyle}">
                    <ItemsControl.ItemTemplate>
                        <DataTemplate>
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="26" />
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="70" />
                                </Grid.ColumnDefinitions>

                                <TextBlock Text="{Binding Description}" Grid.Column="0" Style="{StaticResource ListTextBlockStyle}" />
                                <StackPanel Orientation="Horizontal" Grid.Column="1">
                                    <Button  cal:Message.Attach="Edit($dataContext)" x:Name="Edit" Style="{StaticResource SmallImageResKeyButton}" />
                                    <Button cal:Message.Attach="Remove($dataContext)" x:Name="Remove" Style="{StaticResource SmallImageResKeyButton}" />
                                    <Button cal:Message.Attach="MoveUp($dataContext)" x:Name="MoveUp"  Style="{StaticResource SmallImageResKeyButton}" />
                                    <Button cal:Message.Attach="MoveDown($dataContext)" x:Name="MoveDown"  Style="{StaticResource SmallImageResKeyButton}" />
                                </StackPanel>
                            </Grid>
                        </DataTemplate>
                    </ItemsControl.ItemTemplate>
                </ItemsControl>
            </ScrollViewer>
            
            <Button x:Name="Add" Style="{StaticResource DefaultImageResKeyButton}"  Grid.Row="2" Grid.Column="0" />

            <ContentControl x:Name="ItemDialog" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="5" Grid.RowSpan="3"/>

        </Grid>
    </Border>
</UserControl>
